//
// Created by spiro on 19-3-25.
//

#ifndef C_PRIMER_PLUS_LIST_H
#define C_PRIMER_PLUS_LIST_H

#include <stdbool.h>

/* Special Program Declare */
#define TSIZE 45
struct film {
    char title[TSIZE];
    int rating;
};

/* Generic define */
typedef struct film Item;

typedef struct node {
    Item item;
    struct node * next;
} Node;

typedef Node * List;

/* Function Prototype */

void InitializeList(List * plist);

bool ListIsEmpty(const List * plist);

bool ListIsFull(const List * plist);

unsigned int ListItemCount(const List * plist);

bool AddItem(Item item, List * plist);

void Traverse(const List * plist, void (* pfun)(Item item));

void EmptyTheList(List * plist);

#endif //C_PRIMER_PLUS_LIST_H
